﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 封装debug类 提供时间戳 等其他信息
/// 编译dll  mcs -r:/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll -target:library /Users/MOMO/test13/Assets/Debuger.cs
/// </summary>
public static class MyLog
{
    public static bool IsLog = true;
    public static void Log(object message,UnityEngine.Object content)
    {
        if (IsLog)
        {
            Debug.Log(GetTimeString()+" : "+message,content);
        }
    }

    public static void Log(object message)
    {
        Log(message,null);
    }

    public static void LogWarning(object message, UnityEngine.Object content)
    {
        if (IsLog)
        {
            Debug.LogWarning(GetTimeString()+" : "+message,content);
        }
    }

    public static void LogWarning(object messahe)
    {
        LogWarning(messahe,null);
    }

    public static void LogError(object message, UnityEngine.Object content)
    {
        if (IsLog)
        {
            Debug.LogError(GetTimeString()+" : "+message,content);
        }
    }

    public static void LogError(object message)
    {
        LogError(message,null);
    }

    private static string GetTimeString()
    {
        return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss,fff");
    }
}
